#include "gameover.h"
#include "ui_gameover.h"
#include "data.h"
#include "widget.h"
#include "player.h"
#include <QPixmap>
#include <QPalette>

gameover::gameover(QWidget *parent) :
    QWidget(parent),
    ui(new Ui::gameover)
{
    ui->setupUi(this);


}

gameover::gameover(double s)
{
    setFixedSize(GAME_WIDTH,GAME_HEIGHT);//设置窗口大小

    setAutoFillBackground(true);
    QPalette pal;
    QPixmap pixmap(":/res/img_bg_level_2.jpg");
    pal.setBrush(QPalette::Window, QBrush(pixmap));
    setPalette(pal);

    score = new QLabel(this);
    score->setGeometry(rect().x()+190, rect().y()+300,200, 30);
    score->setFont(QFont("Algerian",18));
    score->setStyleSheet("QLabel{background: transparent; color:white; }");
    score->setText(QString(SCORE).arg(s));

    youdied = new QLabel(this);
    youdied->setGeometry(rect().x()+200, rect().y()+400,200, 30);
    youdied->setFont(QFont("Algerian",18));
    youdied->setStyleSheet("QLabel{background: transparent; color:white; }");
    youdied->setText("YOU DIED");

}

gameover::~gameover()
{
    delete ui;
}

void gameover::on_pushButton_clicked()
{this->close();
emit rep();
}

void gameover::on_pushButton_2_clicked()
{
    this->close();
}
